/*
 * Author  : Pallab
 * Program : D_1.cxx
 *
 * 2011-12-10 11:52:48
 * I have not failed, I have just found 10000 ways that won't work.
 *
 */
#include <iostream>
#include <algorithm>
#include <vector>
#include <sstream>
#include <fstream>
#include <string>
#include <list>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <functional>
#include <bitset>
#include <iomanip>

#include <ctime>
#include <cassert>
#include <cstdio>
#include <cmath>
#include <cstring>
#include <climits>
#include <cstring>
#include <cstdlib>

using namespace std;

#define CI( x ) scanf("%d",&x)
#define CL( x ) scanf("%lld",&x)
#define CD( x ) scanf("%lf",&x )
#define foR(i,st,ed) for(int i = st ; i < ed ; ++i )
#define fo(i,ed) foR( i , 0 , ed )
#define foE(i,st,ed) for(int i = st ; i <= ed ; ++i )
#define foit(i, x) for (typeof((x).begin()) i = (x).begin(); i != (x).end(); i++)
#define bip system("pause")
#define Int long long
#define pb push_back
#define SZ(X) (int)(X).size()
#define LN(X) (int)(X).length()
#define mk make_pair
#define f first
#define s second
#define SET( ARRAY , VALUE ) memset( ARRAY , VALUE , sizeof(ARRAY) )

inline void wait(double seconds) {
    double endtime = clock()+(seconds * CLOCKS_PER_SEC);
    while (clock() < endtime) {
        ;
    }
}
struct POINT {
    int xp;
    int yp;
    POINT(int xp=0,int yp=0)
            :xp(xp),yp(yp) {
        ;
    }
};
vector< POINT > vp;
inline void Read() {
    vp.assign(8,POINT(0,0));
    fo(i,8) {
        scanf("%d %d",&vp[i].xp,&vp[i].yp);
    }
}
inline int dot(POINT A, POINT B, POINT C ) {
    int ab[2];
    int bc[2];
    ab[0] = B.xp-A.xp;
    ab[1] = B.yp-A.yp;
    bc[0] = C.xp-B.xp;
    bc[1] = C.yp-B.yp;
    int d = ( ab[0]*bc[0] ) + ( ab[1]*bc[1] );
    return d;
}
inline Int dist(POINT A, POINT B) {
    Int ax = A.xp-B.xp;
    Int ay = A.yp-B.yp;
    return ( ax*ax + ay*ay );
}

inline bool isRectangle(vector< POINT > vi) {
    Int area = dist( vi[0],vi[1] )*dist( vi[0],vi[3] );
    bool flag = ( dot( vi[0],vi[1],vi[2] )==0 &&
                  dot( vi[1],vi[2],vi[3] )==0 &&
                  dot( vi[2],vi[3],vi[0] )==0 &&
                  dot( vi[3],vi[0],vi[1] )== 0 ) ;
    return ( flag && area!=0 ) ;
}
inline bool isSquare(vector< POINT > vi) {
    bool flag1 = isRectangle( vi );
    bool flag2 = ( dist( vi[0], vi[1] ) == dist( vi[1],vi[2] ) &&
                   dist( vi[0], vi[1] ) == dist( vi[0],vi[3] ) &&
                   dist( vi[0], vi[1] ) == dist( vi[3],vi[2] ) ) ;

    return ( flag1 && flag2 ) ;
}
inline void Proc() {
    vector<int> p;
    fo(i,8) {
        p.pb(i);
    }


    vector< POINT > sq(4,POINT(0,0));
    vector< POINT > re(4,POINT(0,0));
    do {
        for (int i=0;i<4;++i) {
            sq[i] = vp[ p[i] ];
        }
        for (int i=4;i<8;++i) {
            re[i-4] = vp[ p[i] ];
        }
        if ( isSquare(sq) && isRectangle(re) ) {
            cout<<"YES\n";
            foR(i,0,4) {
                if (i!=0) {
                    cout<<" ";
                }
                cout<<p[i]+1;
            }
            cout<<"\n";
            foR(i,4,8) {
                if (i!=4) {
                    cout<<" ";
                }
                cout<<p[i]+1;
            }
            cout<<"\n";
            return ;
        }
    } while ( next_permutation(p.begin(),p.end()) );

    cout<<"NO\n";
}
int main() {
    Read();
    Proc();
    return 0;
}
// kate: indent-mode cstyle; space-indent on; indent-width 0; 
